-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
util: optimize informers transformers #1736
base: main
Are you sure you want to change the base?
util: optimize informers transformers #1736
Conversation
Signed-off-by: dongjiang1989 <[email protected]>
Signed-off-by: dongjiang1989 <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1736 +/- ##
=======================================
Coverage 67.52% 67.53%
=======================================
Files 413 414 +1
Lines 46072 46096 +24
=======================================
+ Hits 31111 31131 +20
- Misses 12705 12708 +3
- Partials 2256 2257 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Maybe golangci-lint timeout? |
Signed-off-by: dongjiang1989 <[email protected]>
pkg/util/transformer/transformers.go
Outdated
@@ -45,5 +45,9 @@ func SetupTransformers(informerFactory informers.SharedInformerFactory, koordInf | |||
if err := informer.Informer().SetTransform(transformFn); err != nil { | |||
klog.Fatalf("Failed to SetTransform in informer, resource: %v, err: %v", resource, err) | |||
} | |||
// clean up partial metadata | |||
if err := informer.Informer().SetTransform(PartialMetadataRemoveTransform); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If set PartialMetadataRemoveTransform as transformer here, it will replace the exist transformer. It's not the expected.
If you want to do this, you should wrap the transformFn with PartialMetadataRemoveTransform.
Signed-off-by: dongjiang1989 <[email protected]>
@dongjiang1989 Hi, the transformers are now only used by the scheduler. If you want to apply the same functionality in koord-manager and koordlet, you should update more codes. |
Thanks for your review. Code update immediately! |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/milestone 1.5 |
@ZiMengSheng: The provided milestone is not valid for this repository. Milestones in this repository: [ Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/milestone v1.5 |
Signed-off-by: dongjiang1989 <[email protected]>
@eahydra Please re-check |
/assign @ZiMengSheng |
Ⅰ. Describe what this PR does
The optimization has been inspired by cert-manager/cert-manager#5966
By stripping the rest of the metadata, we can save a bit of memory on clusters with lots of pods.
Ⅱ. Does this pull request fix one issue?
Ⅲ. Describe how to verify it
Ⅳ. Special notes for reviews
V. Checklist
make test